package routers

import (
	v1 "blog/api/v1"
	"blog/middleware"
	"github.com/gin-gonic/gin"
)

func InitUserRouter(Router *gin.RouterGroup) {
	userRouter := Router.Group("")
	userRouter.Use(middleware.JwtToken())
	{
		// 用户信息模块
		userRouter.PUT("user/:id", v1.EditUser)
		userRouter.DELETE("user/:id", v1.DeleteUser)
		//上传文件
		userRouter.POST("upload", v1.UpLoad)
	}
	router := Router.Group("")
	{
		router.POST("user/add", v1.AddUser)
		router.GET("users", v1.GetUsers)
		//用户登录
		router.POST("login", v1.Login)
	}
}
